package chapter1;

/**
 * @author ycj
 * @version 1.0
 * @description: TODO
 * @date 2022/5/16
 */

//简易倒计时器

public class Source1_6 {
    private static int count;
    public static void main(String[] args) {
        count=args.length>=1?Integer.parseInt(args[0]):60;
        int currentSeconds;
        while(true){
            currentSeconds=countDown();
            if(currentSeconds==0){
                break;
            }else{
                System.out.println("Remaining="+currentSeconds+"seconds");
            }

            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }
    }

    public static int countDown(){
        return --count;
    }
}
